#include "PayOffBridge.h"

PayOffBridge::PayOffBridge(const PayOff& innerPayOff)
{
	m_payoffptr = innerPayOff.clone();
}

PayOffBridge::PayOffBridge(const PayOffBridge& rhs)
{
	m_payoffptr = rhs.m_payoffptr->clone();
}

PayOffBridge& PayOffBridge::operator=(const PayOffBridge& rhs)
{
	if(this != &rhs) {
		delete m_payoffptr;
		m_payoffptr = rhs.m_payoffptr->clone();
	}
	return *this;
}

PayOffBridge::~PayOffBridge()
{
	delete m_payoffptr;
}

double PayOffBridge::operator()(double S_T) const
{
	return m_payoffptr->operator()(S_T);
}